local _insert = table.insert
function table.insert(tbl, ...)
    _insert(tbl, ...)
    tbl.length = #tbl
end

local list = ObservableList()

local obj = Observable{
    sum = 0
}

Bind(obj, "sum", function()
    local sum = 0
    for i = 1, list.length do
        sum = sum + list[i].num
    end
    print('sum', sum)
    return sum
end, Update_mode.NextTick)

for i = 1, 8 do
    local item = Observable{
        num = 10,
        ori = 13,
    }
    Bind(item, "num", function()
        return item.ori + 1
    end, Update_mode.NextTick)
    table.insert(list, item)
end

for i = 1, 1000 do
    UpdateObservers()
end

UnBind(obj, "sum")
list[1].ori = 100
UpdateObservers()
UpdateObservers()
UpdateObservers()
UpdateObservers()
UpdateObservers()
UpdateObservers()
UpdateObservers()
UpdateObservers()
UpdateObservers()